﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Empires.RAL.Access;
using Empires.RAL.ORM;

namespace Empires.RAL.Pump
{
    public class AppTempleteDataPump : IAppTempleteAccess
    {
        public T GetTempleteInfo<T>(int id) where T : class
        {
            using (mysql_empiresEntities ctx = new mysql_empiresEntities())
            {
                var info = (from c in ctx.tb_style
                            where c.id == id
                            select c).FirstOrDefault();
                if (info != null && info is T)
                {
                    return (T)Convert.ChangeType(info, typeof(T));
                }
                return null;
            }
        }
    }
}
